#include "input.hpp"

InputManager::InputManager(float smoothness){
    setSmoothness(smoothness);
}

void InputManager::setSmoothness(float s){
    smoothness = s;
}

float InputManager::getValue(float timedelta){
    value = pow(smoothness, timedelta) * value + (1 - pow(smoothness, timedelta)) * rawValue;
    if(abs(rawValue) < 0.01f and abs(value) < 0.01f)value = 0.0f;
    return value;
}
